package com.mall4j.cloud.api.coupon.constant;

import com.fasterxml.jackson.annotation.JsonValue;
// 优惠卷类型
public enum CouponTypeEnum {
    NO_THRESHOLD(0),
    FULL_REDUCE(1);
    private final Integer value;

    public Integer getValue() {
        return value;
    }

    public static CouponTypeEnum  getType(int type) {
        for(CouponTypeEnum item:CouponTypeEnum.values()) {
            if(item.value==type) {
                return item;
            }
        }
        return null;
    }
    @JsonValue
    public Integer value() {
        return value;
    }

    CouponTypeEnum(Integer value) {
        this.value = value;
    }
}
